Summary:
	These are the replication materials for "A Text-As-Data Approach for Using Open-Ended Responses as Manipulation Checks" published in Political Analysis. The project is intended to help researchers analyze manipulation checks that employ open-ended responses. Below, I list all of the files included in the Dataverse folder that are needed to replicate the figures and tables found in the manuscript as well as the supplementary materials.

Contents:
	/figures:	
		Fig1.pdf		Fig2.pdf		Fig3.pdf		Fig4.pdf		FigSM1.jpg		FigSM2.pdf		FigSM4.pdf		FigSM5.pdf		FigSM6.pdf		FigSM7.pdf		FigSM9a.pdf		FigSM9b.pdf		FigSM10a.pdf		FigSM10b.pdf		FigSM11.pdf		FigSM12.pdf		FigSM13.pdf
	/replication_code:
		zelig_fix.R
		replication_conditional_accept.R
		replication_OnlineAppendix.R
	/tables:
	/tex_files:	
		extracted.bib		PA_conditional_accept.pdf		PA_conditional_accept.tex		PA_SM_conditional_accept.pdf		PA_SM_conditional_accept.tex

Computational Requirements:
	- I used the current version of R (4.0.3) for construction as of 11/2020, but the package only requires R (>= 3.1.0)
	- OS: Created on macOS Catalina (10.15.6), 8GB RAM, 3.4 GHz i5
	- Runtime: < 2.5 minutes for all .R files combined
	- R package imports (everything will be automatically installed if you follow directions below, including actual dependencies and dependencies for other packages):
		stringdist (0.9.6),
		stringr (1.4.0),
		ggplot2 (3.3.2),
		tidyr (1.1.1),
		data.table (1.12.8),
		reshape2 (1.4.4),
		ggridges (0.5.2),
		AER (1.2-7),
		Zelig (5.1.6.1),
		ggcorrplot (0.1.3),
		texreg (1.37.5),
		text2vec (0.6),
		plyr (1.8.6),
		MASS (7.3-51.5),
		RcppAlgos (2.4.1),
		tidyverse (1.3.0),
		ggpubr (0.4.0),
		xtable (1.8-4),
		rmarkdown,
		knitr

Package/Replication Process:
	- Instructions: To facilitate easy replication and extension of my method, I have created a package in R called 'openEnded' (https://github.com/jeffreyziegler/openEnded). All of the data and functions required to replicate the paper can be called via this package. You will need to install and load 'openEnded', but first there are a couple of things to consider. Since you're likely running R version 4, and the 'openEnded' package relies on 'Zelig' which has been removed from CRAN (as of 11/2020), you will need to install a couple of packages in R before installing 'openEnded' that are not dependencies, but are necessary to make the legacy version of Zelig functional. To do this, open 'replication_conditional_accept.R' and you will be prompted to source 'zelig_fix.R'. Once you have executed the contents of this file (which just installs a bunch of packages for the old Zelig), you can install 'openEnded' (see below for code) and proceed with the replication. 

	- Installation (copy and paste into R):
		devtools::install_github('jeffreyziegler/openEnded', force=T)


Citation:

@article{ziegler2020,
  title={A Text-As-Data Approach For Using Open-Ended Responses As Manipulation Checks},
  author={Ziegler, Jeffrey},
  journal={Political Analysis}
}

Contact:
	- Author: Jeffrey Ziegler, PhD
	- Email: jeffreyziegler@emory.edu